package com.dancosoft.vika.implementation;

import com.dancosoft.vika.Entity.Product;
import com.dancosoft.vika.Entity.ProductPart;
import com.dancosoft.vika.Interface.IAssemblyLine;

public class AssembleLineImpl implements IAssemblyLine {

	LineStepImpl lineStepImpl = new LineStepImpl();
	ProductImpl productimpl = new ProductImpl();

	@Override
	public Product assembleProduct(Product product) {

		ProductPart first = new Step1Impl().buildProductPart();
		ProductPart second = new Step2Impl().buildProductPart();
		ProductPart third = new Step3Impl().buildProductPart();

		productimpl.installFirstPart(first);
		productimpl.installSecondPart(second);
		productimpl.installThirdPart(third);

		product.setFirstPart(first);
		product.setSecondPart(second);
		product.setThirdPart(third);

		System.out.println("Assemble product");
		return product;
	}

}
